using UnityEngine;
using System.Collections;

/// \class  gkAddComponentOnAwake
/// \brief 	Add component on awake
[AddComponentMenu("GK/Engine/Base/Component/gkAddComponentOnAwake")]
public class gkAddComponentOnAwake : MonoBehaviour
{
	/// The component type to add
	public string ComponentTypeName;
	
	/// The number of component to add
	public int NbToAdd = 1;
	
	/// \brief  Called on script load
	void Awake()
	{
		// Attach a certain amount of receiver
		for(int i = 0; i < NbToAdd; i++)
		{
			gameObject.AddComponent(ComponentTypeName);
		}
		
		Destroy(this);
	}
}